<template>
  <div class="custom-nav">
    <div class="nav-content">
      <div class="nav-left">
        <a href="/" class="nav-title">
          Claude Code 使用指南
        </a>
      </div>
      
      <div class="nav-center">
        <a href="/" class="nav-link">首页</a>
        <a href="/installation/" class="nav-link">安装指南</a>
        <a href="/mcp/" class="nav-link">MCP 工具</a>
        <a href="/subagents/" class="nav-link">Subagents</a>
        <a href="/tips/" class="nav-link">使用技巧</a>
      </div>
      
      <div class="nav-right">
        <ThemeSwitcher />
      </div>
    </div>
  </div>
</template>

<script setup>
import ThemeSwitcher from './ThemeSwitcher.vue'
</script>

<style scoped>
.custom-nav {
  background: var(--vp-c-bg);
  border-bottom: 1px solid var(--vp-c-border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(var(--vp-c-bg-rgb), 0.8);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-left {
  flex-shrink: 0;
}

.nav-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--vp-c-text-1);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-title:hover {
  color: var(--vp-c-brand);
}

.nav-center {
  display: flex;
  gap: 2rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: var(--vp-c-text-1);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--vp-c-brand);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--vp-c-brand);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-right {
  flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .custom-nav {
    padding: 1rem;
  }
  
  .nav-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-center {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .nav-link {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .nav-title {
    font-size: 1rem;
  }
  
  .nav-center {
    gap: 0.5rem;
  }
  
  .nav-link {
    font-size: 0.8rem;
  }
}
</style>